// src/api/party.js
import request from '@/utils/request'

export function createActivity(data) {
	return request({ url: '/api/party/activities', method: 'post', data })
}
export function listActivities(params) {
	return request({ url: '/api/party/activities', method: 'get', params })
}
export function getActivity(id) {
	return request({ url: `/api/party/activities/${id}`, method: 'get' })
}
export function updateActivity(id, data) {
	return request({ url: `/api/party/activities/${id}`, method: 'put', data })
}
export function deleteActivity(id) {
	return request({ url: `/api/party/activities/${id}`, method: 'delete' })
}
export function upsertAttendance(activityId, data) {
	return request({ url: `/api/party/activities/${activityId}/attendance`, method: 'post', data })
}
export function uploadActivityAttachment(activityId, file) {
	const fd = new FormData()
	fd.append('file', file)
	return request({ url: `/api/party/activities/${activityId}/attachments`, method: 'post', data: fd, headers: { 'Content-Type': 'multipart/form-data' } })
}
export function listActivityAttachments(activityId) {
	return request({ url: `/api/party/activities/${activityId}/attachments`, method: 'get' })
} 

export function reviewActivity(activityId, data) {
    return request({ url: `/api/party/activities/${activityId}/review`, method: 'post', data })
}